﻿<!DOCTYPE html>
<html lang="zn" xmlns:th="http://www.thymeleaf.org">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<head>
        <meta charset="utf-8">
        <title> 新建角色 </title>
        <meta name="renderer" content="webkit">
        <base th:href="@{/}"/>
        <meta http-equiv="Cache-Control" content="no-cache"/>
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="format-detection" content="telephone=no">
        <link rel="stylesheet" href="static/css/x-admin.css" media="all">
        <link rel="stylesheet" href="static/css/backstage.css" media="all">
        <script src="static/js/jquery.min.js"></script>

        <script>
			function addRole(){
					if(confirm("确定提交吗?")==true){
					  $.ajax({
		 	    			url:"admin/roleAdd",
		 	    			type:"post",
		 	    			data:{
		 	    				roleId:$("#roleId").val(),
		 	    				roleName:$("#roleName").val(),
		 	    			},
		 	    			dataType:"json",
		 	    			success:function(data){
		 	    				alert(data.message);
		 	    				window.location.href="admin/role";
		 	    			}
		 	    			
		 	    		});
					 }

			}
        </script>
        

    </head>
    
    <body>
     <div class="wrap">
        <div class="x-nav">
            <div class="title">
              <a><cite>系统设置 >> 新建管理员帐号</cite></a>               
              <a  class="back" onclick="window.history.back(-1)">返回上页</a>
        	</div>        
        </div>
        <div class="x-body">
         	 <form action="" class="fom">
         	 	<div class="adduser clearfix">
                  <div class="adminimg"> <img src="static/images/admin.png" ></div>
                   <div class="inputright">
                       <h2>新建角色</h2>
                       <p>
                        <label> 角色Id</label>
                        <input id="roleId" class="lg"  placeholder="输入账号" ><span class="msg" id="adminName_msg">*</span>
                       </p>
                       <p>
                        <label>角色名字</label>
                        <input id="roleName" class="lg" placeholder="管理员真实姓名"> <span class="msg" id="realName_msg">*</span>
                       </p>
                      <p>
                        <input id="btnAdd" type="button" value="提交" class="btn" onclick="addRole()"  >
                      </p>
                   </div>            
         		</div>
          </form>              
    </div>
</div>
</body>

</html>